package vmcs.boundary.listener;

import vmcs.controller.MaintenanceController;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * Title:        VMCS
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      ISS
 * @author Pang Pingli
 * @version 1.0
 */

 import java.awt.*;

public class DrinkDisplayListener implements ActionListener {

  private MaintenanceController       mCtrl;

  public DrinkDisplayListener(MaintenanceController  mctrl) {
    mCtrl = mctrl;
  }
  public void actionPerformed(ActionEvent e) {
      Button  btn;
      String  cmd;
      int     idx;

      btn = (Button) e.getSource();
      cmd = btn.getActionCommand();
      idx = Integer.parseInt(cmd);

      mCtrl.displayDrinks(idx);
  }

}